<template>
  <div class="qa-set">
    <div class="title">
      <span>问卷设置</span>
    </div>   
    <div class="dates">
      <!-- <div class="date">
        起止时间
      </div> -->
      <div class="date">
        <el-checkbox v-model="isDate" label="设置起止时间" border size="medium" style="width: 90%" @change="changeDate"></el-checkbox>
      </div>
      <div class="date">
        <el-date-picker
        v-model="begin"
        type="datetime"
        placeholder="选择开始时间"
        value-format="YYYY-MM-DD HH:mm:ss"
        style="width: 90%"
        @change="changeBegin"
        >
        </el-date-picker>
      </div>
      <div class="date">
        <el-date-picker
        v-model="end"
        type="datetime"
        placeholder="选择结束时间"
        value-format="YYYY-MM-DD HH:mm:ss"
        style="width: 90%"
        @change="changeEnd"
        >
        </el-date-picker>
      </div>
      <!-- <div class="date">
        <el-checkbox v-model="isAutoSubmit" label="截止自动提交" border size="medium" style="width: 90%" @change="changeSubmit"></el-checkbox>
      </div> -->
      <div class="date">
        <el-checkbox v-model="randomType" label="题目乱序" border size="medium" style="width: 90%" @change="changeRandom"></el-checkbox>
      </div>
      <div class="date">
        <el-checkbox v-model="isAutoLabel" label="自动编号" border size="medium" style="width: 90%" @change="changeLabel"></el-checkbox>
      </div>
    </div>
    
  </div>
</template>

<script>
export default {
  name:'QaSet',
  data(){
   return {

   }
  },
  props: {
    begin: {
      type: String,
      default: null,
    },
    end: {
      type: String,
      default: null,
    },
    isAutoSubmit: {
      type: Boolean,
      default: false,
    },
    randomType: {
      type: Boolean,
      default: false,
    },
    isAutoLabel: {
      type: Boolean,
      default: true,
    },
    isDate: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    changeDate() {
      this.$emit('changeDate',this.isDate)
      console.log(this.isDate);
    },
    changeBegin() {
      this.$emit('changeBegin',this.begin)
      console.log(this.begin);
    },
    changeEnd() {
      this.$emit('changeEnd',this.end)
      console.log(this.end);
    },

    changeLabel() {
      this.$emit('changeLabel',this.isAutoLabel)
      console.log(this.isAutoSubmit);
    },

    changeRandom() {
      this.$emit('changeRandom',this.randomType)
      console.log(this.randomType);
    },

    changeSubmit() {
      this.$emit('changeSubmit',this.isAutoSubmit)
      console.log(this.isAutoSubmit);
    },
  }
}
</script>

<style scoped src='assets/css/editcss/qaSet.css'>
  /* @import url('./css/qaSet.css'); */
</style>
